package com.lorenzogao.pley.common.util

import android.content.Context

/**
 * 作者：Lorenzo Gao
 * Date: 2017/12/29
 * Time: 9:35
 * 邮箱：2508719070@qq.com
 * Description:
 */
class SizeUtil {
    companion object {

        fun dip2px(context: Context, dipValue: Float): Int {
            var scale = context.resources.displayMetrics.density
            return (dipValue * scale + 0.5f).toInt()
        }
        fun px2dip(context: Context, pxValue: Float): Int {
            var scale = context.resources.displayMetrics.density
            return (pxValue / scale + 0.5f).toInt()
        }



    }

}